//
//  HRZHomeItemBaseModel.m
//  EMarket
//
//  Created by 石头 on 2018/9/4.
//  Copyright © 2018 好日子. All rights reserved.
//

#import "HRZHomeItemBaseModel.h"
// Controllers

// Models
#import "HRZHomeRecommentBaseItem.h"
// Views

// Vendors

// Categories

// Others


@implementation HRZHomeItemModel

@end

@implementation HRZHomeItemBaseModel

- (NSMutableArray *)itemModels{
    if (!_itemModels) {
        _itemModels = [[NSMutableArray alloc] init];
    }
    return _itemModels;
}

+ (id)initBaseModel {
    HRZHomeItemBaseModel *model = [[HRZHomeItemBaseModel alloc] init];
    
    for (int i = 0 ; i < 4; i ++) {
        HRZHomeItemModel *model_cs = [[HRZHomeItemModel alloc] init];
        switch (i%4) {
            case 0:
                model_cs.type = HomeItemTypeCarousel;
                
                break;
            case 1:
                model_cs.type = HomeItemTypeTheme;
                break;
            case 2:
                model_cs.type = HomeItemTypeBigbrand;
                break;
            case 3:
                model_cs.type = HomeItemTypeHotClassify;
                break;
            default:
                break;
        }
        
        NSMutableArray *items = [NSMutableArray array];
        for (int j = 0; j < arc4random()%6 + 4; j++) {
            HRZHomeRecommentBaseItem *item = [HRZHomeRecommentBaseItem initBaseModel];
            
            [items addObject:item];
        }
        model_cs.items = items;
        
        [model.itemModels addObject:model_cs];
    }
    
    
    return model;
}

@end
